/* 
 * File:   math_algos.h
 * Author: aishwarya
 *
 * Created on March 21, 2011, 11:42 AM
 * Mathematics algorithms (Sieves, Euclid's GCD etc)
 */

#ifndef MATH_ALGOS_H
#define	MATH_ALGOS_H

#ifdef	__cplusplus
extern "C" {
#endif

/* Generates prime numbers upto the integer specified by primes_upto.
 * Stores the result in the array primes[] and returns number of primes
 * generated upto primes_upto.
 * @args primes[n] will contain the nth prime number within primes_upto.
 * @args list[n] will be 1 if n is a prime number, 0 otherwise.
 * Size of primes[] and list[] arrays should be primes_upto+1 elements.
 */
int sieveOfAtkin(int primes[], int list[], int primes_upto) ;



#ifdef	__cplusplus
}
#endif

#endif	/* MATH_ALGOS_H */

